﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WCFServiceAuthentication
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
    public class ServiceAuthentication : IServiceAuthentication
    {
        public bool Login(User user)
        {
            if (user == null || user.Name == null || user.Password == null)
            {
                return false;
            }

            if (user.Name.Equals("appusertarget") && user.Password.Equals("pwd@123"))
                return true;
            else
                return false;
        }

        public bool LoginString(string userName, string userPassword)
        {
            if (userName == null || userPassword == null)
            {
                return false;
            }

            if (userName.Equals("appusertarget") && userPassword.Equals("pwd@123"))
                return true;
            else
                return false;
        }
    }
}
